"""
    md5加密
"""
import hashlib
from django.conf import settings


# def md5(text_str):
#     """
#         标准的md5加密
#     """
#     result_str = hashlib.md5()
#     result_str.update(text_str.encode("utf-8"))
#     return result_str.hexdigest()
def md5(text_str):
    """
        标准的md5加密
    """
    result_str = hashlib.md5(settings.SECRET_KEY.encode("utf-8")) # 加盐  SECRET_KEY django随机生产的
    result_str.update(text_str.encode("utf-8"))
    return result_str.hexdigest()